import * as TYPES from "../../Action/wallet/wallet.jsx";

const initData = {
	selectCouponList: [], // 可选择的优惠券列表
	selectedCoupon: undefined // 当前已经选择的卡券
};

const walletReducer = (state = initData, { type, data }) => {
	switch (type) {
		case TYPES.WALLET_COUPON_LIST:
			return {
				...state,
				selectCouponList: data
			};
		case TYPES.WALLET_SELECT_COUPON:
			return {
				...state,
				selectedCoupon: data
			};
		default:
			return state;
	}
};
export default walletReducer;
